package nl.haemers.testrunners 
{
	import flash.events.Event;
	import nl.haemers.data.reflection.Type;
	import nl.haemers.data.serializers.ObjectSerializer;
	import nl.haemers.test.data.vo.AddressVO;
	import nl.haemers.test.data.vo.EnvironmentVO;
	import nl.haemers.utils.Logger;
	import nl.haemers.test.data.vo.TestVO;
	import nl.haemers.timer.StopWatch;
	/**
	 * ...
	 * @author Jonathan Haemers
	 */
	public class ObjectRunner extends BaseRunner 
	{
		
		public var oSeralizer			:ObjectSerializer;
		public var vo					:EnvironmentVO;
		
		public var timer				:StopWatch;
		
		public function ObjectRunner() 
		{
			
		}
		
		/** Public methods **/
		
		/** Getters & Setters **/
		
		/** Protected methods **/
		override protected function init(e:Event = null) : void
		{
			timer = new StopWatch();
			
			super.init(e);
		}
		
		override protected function startup() : void
		{
			timer.start();
			var type:Type = ObjectSerializer.getType(new TestVO());
			timer.stop();
			var _instance:Object = type.instance as Object;
			//without complex data 79ms / 66ms
			Logger.i(timer.currentTime + "ms", timer);
			trace(type.accessors.getAccessor("title"));
			trace(type.accessors.getAccessor("address"));
			var type2:Type = type.accessors.getAccessor("address").objectType;
			var _instance2:AddressVO = type2.instance as AddressVO;
			trace(_instance2);
		}
		
		/** Private methods **/
		
	}

}